

class Calculator{
    private int num1;
    private int num2;

    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }

    public int add(){
        return num1 + num2;
    }
    public int sub(){
        return num1 - num2;
    }
    public int mul(){
        return num1 * num2;
    }
    public double dev(){
        return num1 * 1.0 / num2;
    }
}
public class test {
//编写一个类Calculator,有两个属性num1,num2,这两个数据的值，
// 不能在定义的同时初始化，最后实现加减乘除四种运算.
    public static void main1(String[] args) {
        Calculator calculator = new Calculator();
        calculator.setNum1(3);
        calculator.setNum2(2);
        System.out.println(calculator.add());
    }

}
